package one;

import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * Description:
 *
 * @author xzj
 * @date 2021/1/12 22:53
 * @since JDK 1.8
 */
public class StreamDemo {
    public static void main(String[] args) {

        Stream.of(new Apple("green", 100),
                new Apple("yellow", 300),
                new Apple("green", 200))
                .filter(Apple.findYellow.or(Apple.findWeight100))
                .peek(apple -> apple.setWeight(apple.getWeight() + 1))
                .collect(Collectors.toList()).forEach(System.out::println);
    }
}
